package tree;

public class BinaryTreeTest {
    public static void main(String[] args) {
        BinaryTree tree = new BinaryTree("A(B(C,),D(E(G(I), H), F))");
        System.out.println("二叉树：" + tree.toString()); 
        System.out.println("节点为Ｄ的二叉树：" + tree.findNode('D'));
        System.out.println("二叉树高度：" + tree.binaryHeight());
        System.out.println("二叉树节点数：" + tree.nodesCount());
        System.out.println("二叉树叶子节点数:" + tree.leafNodesCount());
        System.out.println("二叉树非叶子节点个数:" + tree.notLeafNodesCount());
        System.out.println("Ｄ节点所在的层次是:" + tree.findNodeLevel('D'));
        System.out.println("第4层的节点数是:" + tree.KLevelNodesCount(-1));
    }
}